﻿using ExcellOnServices.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ExcellOnServices.Controllers
{
	public class BaseController : Controller
	{
		private ExcellOnServicesContext _db;
		protected ExcellOnServicesContext db {
			get {
				if (_db == null) {
					_db = new ExcellOnServicesContext();
				}

				return _db;
			}
			set {
				_db = value;
			}
		}

		protected override void Dispose(bool disposing) {
			if (disposing) {
				db.Dispose();
			}
			base.Dispose(disposing);
		}
	}
}